import 'package:flutter/widgets.dart';

import 'webview/io_webview.dart'
    if (dart.library.html) 'webview/web_webview.dart';

abstract class WebviewBridge {
  final String platform;
  WebviewBridge(this.platform);

  factory WebviewBridge.adaptive() {
    return WebviewBridgeImpl.init();
  }

  Future<bool> create();

  bool load(String url);

  void dispose();
}

class Webview extends StatefulWidget {
  const Webview({Key? key}) : super(key: key);

  @override
  State<Webview> createState() => _WebviewState();
}

class _WebviewState extends State<Webview> {
  @override
  void didUpdateWidget(covariant Webview oldWidget) {
    super.didUpdateWidget(oldWidget);
  }

  @override
  Widget build(BuildContext context) {
    return const Text('webview0');
  }
}
